<?php

/* 品牌 brand */
class Fabric_infoModel extends BaseModel
{
    var $table  = 'fabric_info';
    var $prikey = 'fabric_info_id';
    var $_name  = 'fabric_info';
    var $_relation = array(
		'belongs_fabric_shop' => array(
			'model' => 'fabric_shop',
			'type' => BELONGS_TO,
			'foreign_key' => 'fabric_shop_id',
            'reverse'       => 'has_fabric_info',
		),
		'belongs_sample' => array(
			'model' => 'sample',
			'type' => BELONGS_TO,
			'foreign_key' => 'sample_id',
            'reverse'       => 'has_fabric_info',
		),
	);
	
	function get_order_ids($fabric_shop_id)
	{
		$sql = "SELECT order_id FROM {$this->table} WHERE fabric_shop_id = {$fabric_shop_id} AND order_id <> '' group by order_id";
		$data = $this->getCol($sql);
		return $data;
	}
	
	function get_sample_ids($fabric_shop_id)
	{
	}
}

?>